package com.medusa.aps.business.modules.modeling.model.input;

import com.medusa.aps.business.modules.modeling.mp.entity.WorkingProcedureEquipment;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 工序设备实体
 *
 * @author miskw
 */
@Data
@Accessors(chain = true)
@Schema(description = "工序设备实体")
public class WorkingProcedureEquipmentDTO {
    @Schema(description = "设备id")
    @NotNull(message = "设备id不能为空")
    private Long equipmentId;
    @Schema(description = "设备编码")
    @NotNull(message = "设备编码不能为空")
    private String equipmentNumber;
    @Schema(description = "设备名称")
    @NotNull(message = "设备名称不能为空")
    private String deviceName;
    @Schema(description = "辅助编码列表")
    private List<WorkingProcedureAuxiliaryDTO> workingProcedureAuxiliary;

    public WorkingProcedureEquipment toWorkingProcedureEquipment(Integer procedureId) {
        return new WorkingProcedureEquipment()
                .setEquipmentId(equipmentId)
                .setEquipmentNumber(equipmentNumber)
                .setDeviceName(deviceName)
                .setWorkingProcedureId(procedureId);
    }
}